Blockchain DEX Screener Insights Agent
工作流概述
这是一个包含15个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "1ZfA8Do3j7lCB3zF",
"meta": {
"instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
"templateCredsSetupCompleted": true
},
"name": "Blockchain DEX Screener Insights Agent",
"tags": [],
"nodes": [
{
"id": "0e57bcd4-661d-40e3-a9d2-c66d5b84171c",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-280,
340
],
"webhookId": "e79527d8-89bd-4974-926c-2bcd8020cfa4",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "518565fc-1ee9-4c19-a300-a2c2bef2bb60",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
80,
340
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "yUizd8t0sD5wMYVG",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "a52660f2-b13a-4dfb-9429-3f8e382fb4a6",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
240,
340
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "6714c6df-cc31-4758-956b-1db42ec3112f",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-260,
-140
],
"webhookId": "08169624-2756-4c11-9ac1-106d63c5af18",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "R3vpGq0SURbvEw2Z",
"name": "Telegram account"
}
},
"typeVersion": 1.1
},
{
"id": "91b1aecd-cbbf-4e17-afca-bb9e6b98e4d0",
"name": "Blockchain DEX Screener Insights Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
580,
40
],
"parameters": {
"text": "={{ $('Telegram Trigger').item.json.message.text }}",
"options": {
"systemMessage": "You are the Blockchain DEX Screener Insights Agent. You have direct access to a suite of tools that interact with the DexScreener API to provide real-time insights from blockchain DEX data. Below is a summary of the available tools, their purposes, and how to use them:
1. **DexScreener Latest Token Profiles**
- **Purpose:** Fetches the latest token profiles.
- **Endpoint:** `/token-profiles/latest/v1`
- **Usage:** Use this tool to retrieve updated profiles, including token details, images, descriptions, and links.
2. **DexScreener Latest Boosted Tokens**
- **Purpose:** Retrieves the latest boosted tokens.
- **Endpoint:** `/token-boosts/latest/v1`
- **Usage:** Use this tool to get current boosted tokens data along with associated details such as token addresses, amounts, and descriptions.
3. **DexScreener Top Token Boosts**
- **Purpose:** Gets tokens with the most active boosts.
- **Endpoint:** `/token-boosts/top/v1`
- **Usage:** Use this tool when you need to identify tokens that are currently experiencing the highest levels of boosting activity.
4. **DexScreener Search Pairs**
- **Purpose:** Searches for trading pairs matching a query.
- **Endpoint:** `/latest/dex/search`
- **Usage:** Provide a query (e.g., `\"SOL/USDC\"`) to find specific pairs along with detailed information on base and quote tokens, pricing, volume, and more.
5. **DexScreener Check Orders Paid for Token**
- **Purpose:** Checks orders paid for a specific token.
- **Endpoint:** `/orders/v1/{chainId}/{tokenAddress}`
- **Usage:** Specify the `chainId` and `tokenAddress` to review the status and details (e.g., processing status, payment timestamp) of token orders.
6. **DexScreener Get Pairs by Chain and Pair Address**
- **Purpose:** Retrieves one or multiple pairs by chain and pair address.
- **Endpoint:** `/latest/dex/pairs/{chainId}/{pairId}`
- **Usage:** Use this tool to obtain detailed pair information by providing the chain ID and specific pair address.
7. **DexScreener Token Pools**
- **Purpose:** Fetches the pools of a given token address.
- **Endpoint:** `/token-pairs/v1/{chainId}/{tokenAddress}`
- **Usage:** Provide the chain ID and token address to receive information on available liquidity pools for that token.
8. **DexScreener Pairs by Token Address**
- **Purpose:** Retrieves one or multiple pairs by token address (supports comma-separated multiple addresses).
- **Endpoint:** `/tokens/v1/{chainId}/{tokenAddresses}`
- **Usage:** Use this tool when you need pair details for one or more tokens. Supply the chain ID and one or more token addresses (up to 30, comma-separated).
**Usage Guidelines:**
- **Rate Limits:** Adhere to the specified rate limits for each endpoint (ranging from 60 to 300 requests per minute).
- **Headers:** Each tool sends the header `Accept: */*` by default.
- **Parameters:** Use the appropriate path or query parameters as specified to tailor your request.
- **Insight Generation:** Leverage these tools to gather data and provide insightful analysis regarding token profiles, boosted tokens, pair search, orders, liquidity pools, and more.
When responding to user queries, determine which tool or combination of tools is best suited to fetch the required data and generate comprehensive insights. Use these tools to validate data points and present up-to-date and reliable information on blockchain DEX activity.
Proceed with providing insights based on the available data from these DexScreener tools."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "dfe730d6-a93c-45a6-a600-5fd552cc88b8",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
1020,
40
],
"webhookId": "24c73b37-4374-4fcf-b3c9-fa9121e25049",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "R3vpGq0SURbvEw2Z",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "223fa9b3-8f49-407c-9a28-0f67bf6a13cc",
"name": "Adds SessionId",
"type": "n8n-nodes-base.set",
"position": [
240,
40
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b5c25cd4-226b-4778-863f-79b13b4a5202",
"name": "sessionId",
"type": "string",
"value": "={{ $json.message.chat.id }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "f88141f2-e5be-46f5-abd5-3f095e04b09d",
"name": "DexScreener Latest Token Profiles",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
400,
340
],
"parameters": {
"url": "https://api.dexscreener.com/token-profiles/latest/v1",
"sendHeaders": true,
"toolDescription": "This tool fetches the latest token profiles from the DexScreener API (rate limit: 60 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "6adb778c-5c98-45b5-9979-013abe5b88a8",
"name": "DexScreener Latest Boosted Tokens",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
580,
340
],
"parameters": {
"url": "https://api.dexscreener.com/token-boosts/latest/v1",
"sendHeaders": true,
"toolDescription": "This tool fetches the latest boosted tokens from the DexScreener API (rate limit: 60 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "10ecdbbe-8d9c-4485-8ce1-45afe72c0ae2",
"name": "DexScreener Top Token Boosts",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
760,
340
],
"parameters": {
"url": "https://api.dexscreener.com/token-boosts/top/v1",
"sendHeaders": true,
"toolDescription": "This tool fetches the tokens with the most active boosts from the DexScreener API (rate limit: 60 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "2a9de1cd-aed7-4037-aaee-582ec1c3a244",
"name": "DexScreener Search Pairs",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1280,
340
],
"parameters": {
"url": "https://api.dexscreener.com/latest/dex/search",
"sendQuery": true,
"sendHeaders": true,
"parametersQuery": {
"values": [
{
"name": "q"
}
]
},
"toolDescription": "This tool searches for pairs matching a query from the DexScreener API (rate limit: 300 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "fe355be2-b158-4f44-bd52-c3ad14297c8b",
"name": "DexScreener Check Orders Paid for Token",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
940,
340
],
"parameters": {
"url": "https://api.dexscreener.com/orders/v1/{chainId}/{tokenAddress}",
"sendHeaders": true,
"toolDescription": "This tool checks orders paid for a token on DexScreener (rate limit: 60 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "a3519f26-61ce-4e5b-9fb8-06a080fbaea4",
"name": "DexScreener Get Pairs by Chain and Pair Address",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1100,
340
],
"parameters": {
"url": "https://api.dexscreener.com/latest/dex/pairs/{chainId}/{pairId}",
"sendHeaders": true,
"toolDescription": "This tool retrieves one or multiple pairs by chain and pair address from the DexScreener API (rate limit: 300 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "da965564-a024-4358-8399-e01775142b36",
"name": "DexScreener Token Pools",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1480,
340
],
"parameters": {
"url": "https://api.dexscreener.com/token-pairs/v1/{chainId}/{tokenAddress}",
"sendHeaders": true,
"toolDescription": "This tool retrieves the pools of a given token address from the DexScreener API (rate limit: 300 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "31cb228c-9a6d-4519-a6a9-7be9cc75716e",
"name": "DexScreener Pairs by Token Address",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1700,
340
],
"parameters": {
"url": "https://api.dexscreener.com/tokens/v1/{chainId}/{tokenAddresses}",
"sendHeaders": true,
"toolDescription": "This tool retrieves one or multiple pairs by token address from the DexScreener API (rate limit: 300 requests per minute).",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "*/*",
"valueProvider": "fieldValue"
}
]
}
},
"typeVersion": 1.1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "2fbb101c-f139-4e20-88d9-88db0d7ce4f9",
"connections": {
"Adds SessionId": {
"main": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Adds SessionId",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"DexScreener Token Pools": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DexScreener Search Pairs": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Adds SessionId",
"type": "main",
"index": 0
}
]
]
},
"DexScreener Top Token Boosts": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DexScreener Latest Boosted Tokens": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DexScreener Latest Token Profiles": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DexScreener Pairs by Token Address": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Blockchain DEX Screener Insights Agent": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"DexScreener Check Orders Paid for Token": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"DexScreener Get Pairs by Chain and Pair Address": {
"ai_tool": [
[
{
"node": "Blockchain DEX Screener Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- @N8N/N8N Nodes Langchain.Chattrigger
- @N8N/N8N Nodes Langchain.Lmchatopenai
- @N8N/N8N Nodes Langchain.Memorybufferwindow
- Telegramtrigger
- @N8N/N8N Nodes Langchain.Agent
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的Gmail账户
- n8n平台访问权限
- Google API凭证
- AI分类服务订阅
配置步骤
- 在n8n中导入工作流JSON文件
- 配置Gmail节点的认证信息
- 设置AI分类器的API密钥
- 自定义分类规则和标签映射
- 测试工作流执行
- 配置定时触发器(可选)
关键参数
| 参数名称 | 默认值 | 说明 |
|---|---|---|
| maxEmails | 50 | 单次处理的最大邮件数量 |
| confidenceThreshold | 0.8 | 分类置信度阈值 |
| autoLabel | true | 是否自动添加标签 |
最佳实践
优化建议
- 定期更新AI分类模型以提高准确性
- 根据邮件量调整处理批次大小
- 设置合理的分类置信度阈值
- 定期清理过期的分类规则
安全注意事项
- 妥善保管API密钥和认证信息
- 限制工作流的访问权限
- 定期审查处理日志
- 启用双因素认证保护Gmail账户
性能优化
- 使用增量处理减少重复工作
- 缓存频繁访问的数据
- 并行处理多个邮件分类任务
- 监控系统资源使用情况
故障排除
常见问题
邮件未被正确分类
检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。
Gmail认证失败
确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。
调试技巧
- 启用详细日志记录查看每个步骤的执行情况
- 使用测试邮件验证分类逻辑
- 检查网络连接和API服务状态
- 逐步执行工作流定位问题节点
错误处理
工作流包含以下错误处理机制:
- 网络超时自动重试(最多3次)
- API错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作